﻿<controls:ChildWindow
           x:Class="WebSiteAdminTool.UI.Views.Security.Users.EditUserModalDialogView"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d"
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
           xmlns:customcontrols="clr-namespace:WebSiteAdminTool.UI.Views.CustomControls" 
           xmlns:sys="clr-namespace:System;assembly=System" 
           Width="400" Height="330"
           Title="{Binding Path=DialogTitle}" 
           DataContext="{Binding ManageUserViewModel, Source={StaticResource ViewModelLocator}}" >
    <Grid Name="LayoutRoot" Style="{StaticResource ManageUserDialogStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="60" />
            <RowDefinition Height="30" />
            <RowDefinition Height="30" />
            <RowDefinition Height="30" />
            <RowDefinition Height="30" />
            <RowDefinition Height="70" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="30*" />
            <ColumnDefinition Width="70*" />
        </Grid.ColumnDefinitions>
        <TextBlock Style="{StaticResource PageNotesStyle}"
                   Grid.Row="0" Grid.ColumnSpan="2">
                <Run>Add a user by entering the user's ID, password, and e-mail address on this page</Run>
        </TextBlock>
        <TextBlock Style="{StaticResource FormFieldLabelStyle}" Text="User Name" Grid.Row="1" />
        <TextBox Style="{StaticResource FormFieldStyle}" Text="{Binding Path=User.UserName, Mode=TwoWay, ValidatesOnExceptions=True}"
                 Grid.Row="1" Grid.Column="1"/>
        <TextBlock Style="{StaticResource FormFieldLabelStyle}" Text="Password" Grid.Row="2" />
        <PasswordBox Style="{StaticResource FormFieldStyle}" Password="{Binding Path=Password, Mode=TwoWay, ValidatesOnExceptions=True}"
                 Grid.Row="2" Grid.Column="1"/>
        <TextBlock Style="{StaticResource FormFieldLabelStyle}" Text="Confirm Password" Grid.Row="3" />
        <PasswordBox Style="{StaticResource FormFieldStyle}" Password="{Binding Path=ConfirmedPassword, Mode=TwoWay, ValidatesOnExceptions=True}"
                 Grid.Row="3" Grid.Column="1"/>
        <TextBlock Style="{StaticResource FormFieldLabelStyle}" Text="E-mail" Grid.Row="4" />
        <TextBox Style="{StaticResource FormFieldStyle}" Text="{Binding Path=User.Email, Mode=TwoWay, ValidatesOnExceptions=True}"
                 Grid.Row="4" Grid.Column="1"/>
        <TextBlock Style="{StaticResource FormFieldLabelStyle}" Text="Description" Grid.Row="5" />
        <TextBox Style="{StaticResource FormFieldCommentStyle}" 
                 Text="{Binding Path=User.Comment, Mode=TwoWay, ValidatesOnExceptions=True}"
                 Grid.Row="5" Grid.Column="1"/>
        <CheckBox Style="{StaticResource IsApprovedStyle}" 
                 IsChecked="{Binding Path=User.IsApproved, Mode=TwoWay, ValidatesOnExceptions=True}"
                 Content="Approved" 
                 Grid.Row="6" Grid.Column="0"/>
        <customcontrols:SaveCancelButtonsControl
            Grid.Row="6" Grid.Column="1" />
    </Grid>
</controls:ChildWindow>
